{
    interface User {
        name: string;
        age?: number;
        sex: boolean
    }

    type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>

    type testOptional = SetOptional<User, "name" | "age">

    const user: SetOptional<User, "name" | "age"> = {
        sex: true
    }
}